package com.common;

import org.apache.poi.ss.formula.functions.T;

import java.util.List;

/**
 * @Author：Luohuiyong
 * @Description:
 * @Date: Created in 14:20 2019/1/9
 */
public class Base {
    private static final String errorcode = "300";
    private static final String successcode = "200";
    public static final String defaultIdPhoto = "http://plgqvjyxr.bkt.clouddn.com/defaultIdPhoto.png";

    public static Result error(String errmsg) {
        return new Result(errorcode,errmsg);
    }

    public Result error(String errorCode, String errmsg) {
        return new Result(errorCode, errmsg, null);
    }

    public Result error(String errorCode, String errmsg, Object object) {
        return new Result(errorCode, errmsg, object);
    }

    public static Result success(){
        return new Result(successcode,"成功");
    }

    public static Result success(String msg){
        return new Result(successcode,msg);
    }

    public static Result success(T object){
        return new Result(successcode,"成功",object);
    }

    public static Result success(List object){
        return new Result(successcode,"成功",object);
    }

    public static Result<T> success(List object,long total,long maxPage) {
        return new Result("200", "成功", object,total,maxPage);
    }


//    public Result success() {
//        return success("OK");
//    }

//    public Result success(String msg) {
//        return new Result(Constants.SUCCESS, msg, null);
//    }

//    public Result success(Object object) {
//        return new Result(Constants.SUCCESS, "OK", object);
//    }

}
